﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo3
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[5];
            for (int i = 0; i < arr.Length; i++)
            {
                arr[i] = Convert.ToInt32(Console.ReadLine());
            }
            int max = arr[0];
            int min = arr[0];
            int avg = 0;
            int sum = GetSum(arr, ref max, ref min, ref avg);
            Console.WriteLine(sum);
            int max1;
            int min1;
            int avg1;
            int sum1 = GetSum1(arr, out max, out min, out avg);
            Console.WriteLine(sum1);
        }

        private static int GetSum1(int[] arr, out int max1, out int min1, out int avg1)
        {
            int sum1 = 0;
            max1 = arr[0];
            min1 = arr[0];
            for (int i = 0; i < arr.Length; i++)
            {
                if (max1 < arr[i])
                {
                    max1 = arr[i];
                }
                if (min1 > arr[i])
                {
                    min1 = arr[i];
                }
                sum1 += arr[i];
            }
            avg1 = sum1 / arr.Length;
            return sum1;
        }
        private static int GetSum(int[] arr, ref int max, ref int min, ref int avg)
        {
            int sum = 0;
            for (int i = 0; i < arr.Length; i++)
            {
                if (max < arr[i])
                {
                    max = arr[i];
                }
                if (min > arr[i])
                {
                    min = arr[i];
                }
                sum += arr[i];
            }
            avg = sum / arr.Length;
            return sum;
        }
    }
}
